﻿using FluentNHibernate.Mapping;

namespace TaskKernel.Domain.Nhibernate.Mappings
{
    public class FileMap : ClassMap<File>
    {
        public FileMap()
        {
            Table("task_Files");
            Id(x => x.UID, "GID").GeneratedBy.GuidNative();
            Map(x => x.FileName, "FileName");
            Map(x => x.Size, "Size");
            Map(x => x.DateCreate, "DateCreate");
            Map(x => x.Content, "FileContent").CustomType("BinaryBlob").ReadOnly();
            Map(x => x.Hash, "Hash");
            References(x => x.Task, "TaskGID");
            References(x => x.Owner, "OwnerGID");
        }
    }
}